#ifndef _FIG_BONE_Object_H_
#define _FIG_BONE_Object_H_


#include "fig_bone_animation.h"


class FIGSfx;
class FIGLifeObj;

class FIGBoneObject : public FIGBoneAnimation
{
public:

	FIGBoneObject();
	~FIGBoneObject();

	struct ExplodingInfo
	{
		math::Vec2						m_RandomMovePos;
		math::Vec2						m_RandomDir;
		float							m_Alpha;
		float							m_RotationSpeed;	
		float							m_Scale;
		float							m_Rotation;
		float							m_Counter;
		FIGSfx*							m_pSFX_ExploeSmoke;
		

		ExplodingInfo() :
					m_Alpha(0),
					m_RotationSpeed(0),
					m_Scale(0),
					m_Rotation(0),
					m_pSFX_ExploeSmoke(NULL),
					m_Counter(0)
		{
			
		}

		void			Reset();
	};

	
	virtual void					Tick(float dt);
	virtual void					Render(const math::Vec2& Offset,float Scale);
	virtual void					RenderShadow(const math::Vec2& Offset,float Scale);

	virtual	math::Vec2				Load(const std::string& File);

	void							Explode(FIGLifeObj* pOwner);
	bool							IsExploding() { return m_ExpldoingCounter > 0; };
	bool							HitTest(const math::Vec2& Pos);
	int								GetBonePartCount()const  {return  (int)m_BoneParts.size(); };	
	const math::Vec2&				GetSize() { return m_Size; }

protected:

	

	float							m_ExpldoingCounter;
	std::vector<ExplodingInfo*>		m_ExplodingInfos;
	math::Vec2						m_Size;

};


#endif